import React from "react";
import PropTypes from "prop-types";
export default function Rfc(props) {
  console.log(props);
  return (
    <div>
      {props.title}---{props.num}---{props.children}
    </div>
  );
}

// 校验传递的数据的数据类型
Rfc.propTypes = {
  title: PropTypes.string.isRequired,
  num: PropTypes.number.isRequired,
  children: PropTypes.element,
};

// 设置属性默认值
Rfc.defaultProps = {
  title: "默认值",
  num: 0,
};
